package pe.com.certicom.moviles.model.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

import pe.com.certicom.moviles.model.beans.Asignacion;
import pe.com.certicom.moviles.model.beans.AsignacionExample;

@Repository
public class AsignacionDAOImpl extends SqlMapClientDaoSupport implements AsignacionDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public AsignacionDAOImpl() {
        super();
    }
    
	@Autowired
	public void createSqlMapClient(SqlMapClient sqlMapClient){
		setSqlMapClient(sqlMapClient);
	}
	

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int countByExample(AsignacionExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("asignacion.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int deleteByExample(AsignacionExample example) {
        int rows = getSqlMapClientTemplate().delete("asignacion.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int deleteByPrimaryKey(Long idAsignacion) {
        Asignacion key = new Asignacion();
        key.setIdAsignacion(idAsignacion);
        int rows = getSqlMapClientTemplate().delete("asignacion.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public void insert(Asignacion record) {
        getSqlMapClientTemplate().insert("asignacion.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public void insertSelective(Asignacion record) {
        getSqlMapClientTemplate().insert("asignacion.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    @SuppressWarnings("unchecked")
    public List<Asignacion> selectByExample(AsignacionExample example) {
        List<Asignacion> list = getSqlMapClientTemplate().queryForList("asignacion.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public Asignacion selectByPrimaryKey(Long idAsignacion) {
        Asignacion key = new Asignacion();
        key.setIdAsignacion(idAsignacion);
        Asignacion record = (Asignacion) getSqlMapClientTemplate().queryForObject("asignacion.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int updateByExampleSelective(Asignacion record, AsignacionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("asignacion.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int updateByExample(Asignacion record, AsignacionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("asignacion.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int updateByPrimaryKeySelective(Asignacion record) {
        int rows = getSqlMapClientTemplate().update("asignacion.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    public int updateByPrimaryKey(Asignacion record) {
        int rows = getSqlMapClientTemplate().update("asignacion.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table asignacion
     *
     * @ibatorgenerated Thu May 02 22:44:13 COT 2013
     */
    private static class UpdateByExampleParms extends AsignacionExample {
        private Object record;

        public UpdateByExampleParms(Object record, AsignacionExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}